<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // substr(start,length)
        var str="1532512210"
        function fn(str,num){
            var max=str.substr(0,num)
            for(var i=0; i<str.length-num+1;i++){
                var s=str.substr(i,num)
                    if(s>max){
                        max=s
                    } 
            }
            console.log(max)
        }
        fn(str,5)
    </script>
</body>
</html>